package com.slz3.business.module.messageManagement.mesLog.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesLog.domain.MesLog;
import com.slz3.business.module.messageManagement.mesLog.domain.MesLogCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class MesLogResAtomic {

    public Mono<ServerResponse> add_$MesLogUpdateLock(ServerRequest req, MesLog mesLog) {
        return MesLogResSafeValid.add(req, mesLog) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.add(req, mesLog);
    }

    public Mono<ServerResponse> delete_$MesLogUpdateLock(ServerRequest req, MesLogCondition mesLogCondition) {
        return MesLogResSafeValid.delete(req, mesLogCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$MesLogUpdateLock(ServerRequest req, MesLog mesLog) {
        return MesLogResSafeValid.modify(req, mesLog) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.modify(req, mesLog);
    }

    public Mono<ServerResponse> info_$MesLogUpdateLock(ServerRequest req) {
        return MesLogResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$MesLogUpdateLock(ServerRequest req, MesLogCondition mesLogCondition) {
        return MesLogResSafeValid.auditSubmit(req, mesLogCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$MesLogUpdateLock(ServerRequest req, MesLogCondition mesLogCondition) {
        return MesLogResSafeValid.audit(req, mesLogCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$MesLogUpdateLock(ServerRequest req, MesLogCondition mesLogCondition) {
        return MesLogResSafeValid.auditReject(req, mesLogCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$MesLogUpdateLock(ServerRequest req, MesLogCondition mesLogCondition) {
        return MesLogResSafeValid.usingEnable(req, mesLogCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$MesLogUpdateLock(ServerRequest req, MesLogCondition mesLogCondition) {
        return MesLogResSafeValid.usingDisable(req, mesLogCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesLogResExecutor.usingDisable(req);
    }
}
